package com.hundsun.fcp.bean;

import java.util.ArrayList;
import java.util.List;

import com.hundsun.fcp.R;



public class MineBean{
	public static class MineItem {
		/**图片icon id*/
		public int mImgResId ;
		/**item 名称*/
		public int mNameResId ;
		/**item 描述*/
		public String mDesc ;
		
		public MineItemType mType = MineItemType.DEFUALT;
		
		public MineItem(int mImgResId, int mNameResId, String mDesc,
				MineItemType mType) {
			super();
			this.mImgResId = mImgResId;
			this.mNameResId = mNameResId;
			this.mDesc = mDesc;
			this.mType = mType;
		}
		
	}
	
	public static ArrayList<MineItem> userItems ;
	
	public static ArrayList<MineItem> systemItems ;
	
	public static ArrayList<MineItem> userItems(){
		if(userItems==null){
			userItems = new ArrayList<MineBean.MineItem>() ;
			userItems.add(new MineItem(R.drawable.mine_my_bankcard, R.string.mine_bankcard, null, MineItemType.USERBANKCARD)) ;
			userItems.add(new MineItem(R.drawable.mine_acc_security, R.string.mine_account_security, null, MineItemType.USERACCOUNT)) ;
		}
		
		return userItems ;
	}
	
	public static void setUserItemDesc(String desc,MineItemType pType){
		if(userItems!=null){
			for(int i=0;i<userItems.size();i++){
				MineItem item = userItems.get(i) ;
				if(item.mType == pType){
					item.mDesc = desc ;
					return ;
				}
			}
		}
	}
	
	
	public static ArrayList<MineItem> systemItems(){
		if(systemItems==null){
			systemItems = new ArrayList<MineBean.MineItem>() ;
			systemItems.add(new MineItem(R.drawable.mine_action_center, R.string.mine_action_center, null, MineItemType.SYSTEMACTION)) ;
			systemItems.add(new MineItem(R.drawable.mine_helping_center, R.string.mine_helping_center, null, MineItemType.SYSTEMHELPING)) ;
			systemItems.add(new MineItem(R.drawable.mine_feedback, R.string.mine_feedback, null, MineItemType.SYSTEMFEEDBACK)) ;
			systemItems.add(new MineItem(R.drawable.mine_about_us, R.string.mine_about_us, null, MineItemType.SYSTEMABOUT)) ;
			systemItems.add(new MineItem(R.drawable.mine_share_friend, R.string.mine_share_friend, null, MineItemType.SYSTEMSHARE)) ;
			systemItems.add(new MineItem(R.drawable.fcp_mine_update, R.string.mine_update, null, MineItemType.SYSTEMUPDATE)) ;
		}
		return systemItems ;
	}

	public static void clear(){
		if(systemItems!=null){
			systemItems.clear() ;
			systemItems = null ;
		}
		
		if(userItems!=null){
			userItems.clear() ;
			userItems = null ;
		}
	}
}

